<!--
 * @Descripttion: 
 * @Version: 1.0
 * @Author: wangph
 * @Date: 2021-03-31 09:46:02
 * @LastEditors: wangph
 * @LastEditTime: 2021-04-27 15:13:26
-->
{extend name="$admin_layout" /}
{block name="content"}
    <div class="row">
        <div class="col-md-12" id="vue_det">
            <div class="box nav-tabs-custom">
                <div class="box-body tab-content">
                    <form class="form row" name="form" id="form" parent_reload="{$url_param.reload|default = '1'}" action="{:url('',$url_param)}" method="post" data-validator-option="{timely:1, theme:'bootstrap'}">
                    <div class="tab-pane active" id="base">
				  	  <!--<div class="alert alert-info">所设置的透传字段如何发送，开发人员请参阅 <a href="{:url('operation/system_message/document')}">技术文档</a></div>	-->
                        <div class="block-content row">
                            <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12" id="form_group_cid">
                                <div class="col-xs-12 label-title" for="type">{:lang('动作名称')}</div>
                                <div class="col-sm-12">
                                    <input name="name" class="form-control" data-rule="required;" data-msg-required="{:lang('请输入动作名称')}" placeholder="{:lang('请输入动作名称')}" value="{$info.name}"/>
                                </div>
                            </div>
			
						
					
                            <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
							<div class="col-xs-12 label-title" for="type">{:lang('透传字段')} <a href="javascript:;" class="btn btn-default add-field">+{:lang('增加字段')}</a></div>
                                <table class="table table-builder table-hover table-bordered table-striped mb10">
                                    <thead>
  									    <th class="">{:lang('字段名')}</th>
                                        <th class="">{:lang('字段描述')}</th>  
										<th class="">{:lang('操作')}</th>  										
                                    </thead>
                                    <tbody class="fields">      
								    {volist name="$info.rule" id="item"}
                                    <tr>
                                        <td class=""> <input name="field[]" value="{$item.field}" class="form-control" data-rule="required;" data-msg-required="{:lang('请输入英文字符')}" placeholder="{:lang('请输入英文字符')}"/></td>
                                        <td class=""> <input name="msg[]" value="{$item.msg}" class="form-control" data-rule="required;" data-msg-required="{:lang('请输入中文描述')}" placeholder="{:lang('请输入中文描述')}"/></td></td>
										<td class=""> <a href="javascript:;" class="btn btn-danger del-field">{:lang('删除')}</a> </td>
                                    </tr>      
									{/volist}
                                    </tbody>
                                </table>                          
                            </div>
                            <div class="block-content row">
                                <div class="form-group col-md-12 col-xs-12">
                                    <div class="col-xs-12">
                                        <button class="btn btn-primary " type="submit" onclick="submitData()"> {:lang('提交')} </button>
                                        <button class="btn btn-default " type="button" onclick="javascript:history.back(-1);return false;"> {:lang('返回')} </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    </form>
                </div>

             </div>
        </div>
    </div>

{/block}
{block name="script"}
<script type="text/javascript">
(function($){
	$(".add-field").click(function(){
	
		var t ='<tr>'
			+ '<td class=""> <input name="field[]" class="form-control" data-rule="required;" data-msg-required="请输入英文字符" placeholder="请输入英文字符"/></td>'
			+'<td class=""> <input name="msg[]" class="form-control" data-rule="required;" data-msg-required="请输入中文描述" placeholder="请输入中文描述"/></td></td>'
			+'<td class=""> <a href="javascript:;" class="btn btn-danger del-field">删除</a> </td>'
			+'</tr>'
		  $(".fields").append(t)	
	})
	$(document).on('click',".del-field",function(){
		$(this).parents("tr").remove()
	})

})(jQuery)
</script>
{/block}


